{% extends "base.phtml" %}


{% block content %}

<div class="box">
    <div class="box-header with-border">
        <div>
         <form method="get" id="search">
                <div class="input-business input-business-sm" >
                    <div class="col-xs-4" style="width: 200px;">
                        <input type="text" name="keyword" class="form-control pull-right" value="{{keyword}}" placeholder="微信昵称">
                    </div>
                   <div class=" checkbox col-xs-5" style="width: 400px;">
                        <label><input type="checkbox" name="buy" value="1" {%if buy%} checked {%endif%}>购买过优惠券</label>
                       <label><input type="checkbox" name="trade" value="1" {%if trade%} checked {%endif%}>有成交记录</label>
                       <label><input type="checkbox" name="views" value="1" {%if views%} checked {%endif%}>有浏览记录</label>
                    </div>
                    <div class="input-business-btn">
                        <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="box-body">
        <table class="table table-bordered  table-hover">
            <tr>
                <th>ID</th>
                <th>昵称</th>
                <th>总优惠券</th>
                <th>剩余优惠券数量</th>
                <th>成交量</th>
                <th>浏览量</th>
                <th>总奖励天数</th>
                <th>剩余奖励天数</th>
                <th>创建时间</th>
                <th style="width: 250px">操作</th>
            </tr>

            {%for k,v in list%}
            <tr>
                <td>{{v.id}}</td>
                <td>{{v.nickname}}</td>
                <td>{{v.buy_num}}</td>
                <td>{{v.buy_num - v.card_num}}</td>
                <td>{{v.trade_num}}</td>
                <td>{{v.views}}</td>
                <td>{{v.award}}</td>
                <td>{{v.award - v.plus_num}}</td>
                <td>{{date('Y-m-d H:i:s',v.dateline)}}</td>
                <td>
                    <a href="views?id={{v.id}}" class="btn btn-primary">查看详情</a>
                </td>
            </tr>
            {%endfor%}
        </table>
    </div>

    <div class="box-footer clearfix">
        {{pageHtml}}
    </div>
</div>
<script>
    function exportXLS(){

        var oid = $("input[name='oid']").val();
        var cid = $("select[name='cid']").val();
        var status = $("select[name='status']").val();

        window.location.href = "/acp/order/export?oid=" + oid + "&cid=" + cid + "&status=" + status;
    }
</script>
{% endblock %}